home *** CD-ROM | disk | FTP | other *** search
- /* This source file is part of the LynxLib miscellaneous library by
- Robert Fischer, and is Copyright 1990 by Robert Fischer. It costs no
- money, and you may not make money off of it, but you may redistribute
- it. It comes with ABSOLUTELY NO WARRANTY. See the file LYNXLIB.DOC
- for more details.
- To contact the author:
- Robert Fischer \\80 Killdeer Rd \\Hamden, CT 06517 USA
- (203) 288-9599 fischer-robert@cs.yale.edu */
-
- /* Return TOS volume name */
-
- #include <osbind.h>
- #include <basepage.h>
-
- /* System variable */
- #define SYSBASE (*( (OS_HEADER **)0x4F2L ))
-
- /* ------------------ System Header Block ---------------------- */
- /* */
- /* This structure is pointed to by SYSBASE (0x4f2) */
-
- typedef struct os_header {
- unsigned bra; /* (0x0) branch to reset handler */
- unsigned version; /* (0x2) TOS version number */
- char *reset_handler; /* (0x4) pointer to reset handler */
- struct os_header *sysbase;/* (0x8) pointer to this block */
- char *osram_end; /* (0xc) pointer to end of os ram */
- long junk1; /* (0x10) (unused) */
- char *magic; /* (0x14) pointer to GEM mem usage block */
- long *build_date; /* (0x18) system build date */
- unsigned os_config; /* (0x1c) OS configuration bits */
- unsigned tos_date; /* (0x1e) TOS system build date */
- char *root; /* (0x20) pointer to OS pool */
- unsigned *kbshift; /* (0x24) pointer to keyboard shift word */
- BASEPAGE **run; /* (0x28) pointer to current process ptr */
- } OS_HEADER;
-
- /*--------------------------------------------------------------------
- * whichtos(&version, &date)
- * Returns TOS version and TOS build date in its arguments
- */
- void whichtos(tosver, tosdate)
- unsigned *tosver, *tosdate;
- {
- long usp = Super(0L);
- *tosver = SYSBASE->version;
- *tosdate = SYSBASE->tos_date;
- Super(usp);
- }
-